<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="file" id="input">
    <button id="upload">上传</button>
    <script>
        const input = document.getElementById('input')
        const upload = document.getElementById('upload')
        upload.addEventListener('click', handleUpload)
        input.addEventListener('change', handleChange)
        let fileObj=null//用户上传的文件信息
        function handleChange(e) {
            console.log(e.target.files);
            const [file] = e.target.files//用户上传的文件
            fileObj=file
        }
        function handleUpload() {
            if(!fileObj) return
            //先将文件信息切片（分解成多个片段）
            const chunkList=createChunk(fileObj)
            console.log(chunkList);
        }
        function createChunk(file,size=5*1024*1024){//
            const chunkList=[]
            let 
        }
    </script>
</body>
</html>